Platform Explorer / Nuxeo Platform 2021.53

Contribution studio.extensions.nuxeo-routing-default--chains

This contribution is part of XML component studio.extensions.nuxeo-routing-default inside nuxeo-routing-default-2021.53.3.jar /OSGI-INF/extensions.xml

Extension Point

Extension point chains of component OperationServiceComponent.

Registration Order

9
The registration order represents the order in which this contribution was registered on its target extention point. This will impact the override/merge behaviour when it is implemented on the target service, and is useful for proper customization of existing contributions.
You can influence this order by adding "require" tags in the containing component declaration, to make sure it is resolved after another component (see "Resolution Order" on components).

Contributed Items

  • <chain id="NRD-AC-PR-ChooseParticipants-Output">
          <operation id="Context.FetchDocument"/>
          <operation id="RunOperation">
            <param name="id" type="string">NRD-AC-PR-LockDocument</param>
            <param name="isolate" type="boolean">false</param>
          </operation>
          <operation id="Context.SetWorkflowVar">
            <param name="name" type="string">initiatorComment</param>
            <param name="value" type="object">expr:NodeVariables["comment"]</param>
          </operation>
        </chain>
  • <chain id="NRD-AC-PR-LockDocument">
          <operation id="Context.FetchDocument"/>
          <operation id="Auth.LoginAs">
            <param name="name" type="string">expr:workflowInitiator</param>
          </operation>
          <operation id="RunOperation">
            <param name="id" type="string">expr:Document.isLocked()?"voidChain":"Document.Lock"</param>
            <param name="isolate" type="boolean">false</param>
          </operation>
        </chain>
  • <chain id="NRD-AC-PR-UnlockDocument">
          <operation id="Context.FetchDocument"/>
          <operation id="Document.Unlock"/>
        </chain>
  • <chain id="NRD-AC-PR-ValidateNode-Output">
          <operation id="Context.FetchDocument"/>
          <operation id="RunOperation">
            <param name="id" type="string">NRD-AC-PR-UnlockDocument</param>
            <param name="isolate" type="boolean">false</param>
          </operation>
          <operation id="RunOperation">
            <param name="id" type="string">logInAudit</param>
            <param name="isolate" type="boolean">false</param>
          </operation>
        </chain>
  • <chain id="NRD-AC-PR-force-validate">
          <operation id="Context.FetchDocument"/>
          <operation id="Auth.LoginAs">
            <param name="name" type="string">expr:Context["workflowInitiator"]</param>
          </operation>
          <operation id="Audit.LogEvent">
            <param name="event" type="string">Consultation time excedeed</param>
            <param name="category" type="string">Review workflow</param>
            <param name="comment" type="string">Some consultation tasks were aborted by the system as they received no feedback message.</param>
          </operation>
          <operation id="Workflow.ResumeNode"/>
        </chain>
  • <chain id="NRD-AC-PR-storeTaskInfo">
          <operation id="Context.FetchDocument"/>
          <operation id="RunScript">
            <param name="script" type="string">This[0]</param>
          </operation>
          <operation id="Context.SetVar">
            <param name="name" type="string">tasksInfo</param>
            <param name="value" type="object">expr:NodeVariables["tasks"]</param>
          </operation>
          <operation id="Context.SetVar">
            <param name="name" type="string">numberNA</param>
            <param name="value" type="object">expr:NodeVariables["tasks"].getNumberEndedWithStatus("NA")</param>
          </operation>
          <operation id="Context.SetVar">
            <param name="name" type="string">numberRejected</param>
            <param name="value" type="object">expr:NodeVariables["tasks"].getNumberEndedWithStatus("reject")</param>
          </operation>
          <operation id="Context.SetVar">
            <param name="name" type="string">numberApproved</param>
            <param name="value" type="object">expr:NodeVariables["tasks"].getNumberEndedWithStatus("approve")</param>
          </operation>
          <operation id="Context.SetVar">
            <param name="name" type="string">numberOfTasks</param>
            <param name="value" type="object">expr:NodeVariables["numberOfTasks"]</param>
          </operation>
          <operation id="Render.Document">
            <param name="template" type="string">template:NRD-PR-TasksInfo</param>
            <param name="filename" type="string">output.ftl</param>
            <param name="mimetype" type="string">text/xml</param>
            <param name="type" type="string">ftl</param>
          </operation>
          <operation id="Context.SetWorkflowVar">
            <param name="name" type="string">review_result_file</param>
            <param name="value" type="object">expr:This.get(0)</param>
          </operation>
          <operation id="Context.SetWorkflowVar">
            <param name="name" type="string">review_result</param>
            <param name="value" type="object">expr:This.get(0).getString()</param>
          </operation>
        </chain>
  • <chain id="cancelWorkflow">
          <operation id="Context.FetchDocument"/>
          <operation id="Context.SetVar">
            <param name="name" type="string">isParallelWF</param>
            <param name="value" type="object">expr:Event.context.getProperty("wfName").equals("wf.parallelDocumentReview.ParallelDocumentReview")?true:false</param>
          </operation>
          <operation id="RunOperation">
            <param name="id" type="string">expr:isParallelWF?"Document.Unlock":"voidChain"</param>
            <param name="isolate" type="boolean">false</param>
          </operation>
        </chain>
  • <chain id="initInitiatorComment">
          <operation id="RunScript">
            <param name="script" type="string">if((NodeVariables["comment"] != "") AND (NodeVariables["comment"] != null)){
    WorkflowVariables["initiatorComment"]= NodeVariables["comment"];}</param>
          </operation>
        </chain>
  • <chain id="logInAudit">
          <operation id="Audit.LogEvent">
            <param name="event" type="string">expr:NodeVariables["button"] =="reject"?"chain.document.refused":"chain.document.validated"</param>
            <param name="category" type="string">Review workflow</param>
            <param name="comment" type="string">expr:@{nodeLastActor} @{NodeVariables["button"] =="reject"?"chain.document.refused":"chain.document.validated"} the document with the following comment: @{NodeVariables["comment"]}</param>
          </operation>
        </chain>
  • <chain id="nextAssignee">
          <operation id="RunScript">
            <param name="script" type="string">if (NodeVariables["button"] == "validate") {
      WorkflowVariables["index"] = WorkflowVariables["index"] + 1;
    }
    else if (NodeVariables["button"] == "reject") {
      WorkflowVariables["index"] = WorkflowVariables["index"] - 1;
    }
    else if (NodeVariables["button"] == "submit") {
      WorkflowVariables["index"] = 0;
    }</param>
          </operation>
        </chain>
  • <chain id="notifyInitiatorEndOfWorkflow">
          <operation id="Context.FetchDocument"/>
          <operation id="Document.Mail">
            <param name="from" type="string">expr:Env["mail.from"]</param>
            <param name="message" type="string">The document was approved by every participant.</param>
            <param name="subject" type="string">expr:@{Env["nuxeo.notification.eMailSubjectPrefix"]} Document approved</param>
            <param name="to" type="stringlist">expr:Fn.getEmail(workflowInitiator)</param>
            <param name="HTML" type="boolean">false</param>
            <param name="rollbackOnError" type="boolean">true</param>
            <param name="viewId" type="string">view_documents</param>
          </operation>
        </chain>
  • <chain id="reinitAssigneeComment">
          <operation id="RunScript">
            <param name="script" type="string">if((NodeVariables["comment"] != "") AND (NodeVariables["comment"] != null)){
    NodeVariables["comment"]= null;}</param>
          </operation>
        </chain>
  • <chain id="terminateWorkflow">
          <operation id="Context.FetchDocument"/>
          <operation id="RunOperation">
            <param name="id" type="string">logInAudit</param>
            <param name="isolate" type="boolean">false</param>
          </operation>
          <operation id="Context.RunDocumentOperationInNewTx">
            <param name="id" type="string">notifyInitiatorEndOfWorkflow</param>
            <param name="isolate" type="boolean">false</param>
            <param name="rollbackGlobalOnError" type="boolean">false</param>
          </operation>
          <operation id="RunOperation">
            <param name="id" type="string">expr:WorkflowVariables["validationOrReview"] == "validation"?"validateDocument":"voidChain"</param>
            <param name="isolate" type="boolean">false</param>
          </operation>
          <operation id="Audit.LogEvent">
            <param name="event" type="string">Review completed successfully</param>
            <param name="category" type="string">Review workflow</param>
            <param name="comment" type="string">All the participants of the review have approved the document.</param>
          </operation>
        </chain>
  • <chain id="validateDocument">
          <operation id="Context.FetchDocument"/>
          <operation id="Document.FollowLifecycleTransition">
            <param name="value" type="string">approve</param>
          </operation>
          <operation id="Document.CheckIn">
            <param name="version" type="string">minor</param>
            <param name="comment" type="string">Automatic checkin after validation</param>
          </operation>
        </chain>
  • <chain id="voidChain">
          <operation id="Context.FetchDocument"/>
        </chain>

XML Source

<extension point="chains" target="org.nuxeo.ecm.core.operation.OperationServiceComponent">
    <chain id="NRD-AC-PR-ChooseParticipants-Output">
      <operation id="Context.FetchDocument"/>
      <operation id="RunOperation">
        <param name="id" type="string">NRD-AC-PR-LockDocument</param>
        <param name="isolate" type="boolean">false</param>
      </operation>
      <operation id="Context.SetWorkflowVar">
        <param name="name" type="string">initiatorComment</param>
        <param name="value" type="object">expr:NodeVariables["comment"]</param>
      </operation>
    </chain>
    <chain id="NRD-AC-PR-LockDocument">
      <operation id="Context.FetchDocument"/>
      <operation id="Auth.LoginAs">
        <param name="name" type="string">expr:workflowInitiator</param>
      </operation>
      <operation id="RunOperation">
        <param name="id" type="string">expr:Document.isLocked()?"voidChain":"Document.Lock"</param>
        <param name="isolate" type="boolean">false</param>
      </operation>
    </chain>
    <chain id="NRD-AC-PR-UnlockDocument">
      <operation id="Context.FetchDocument"/>
      <operation id="Document.Unlock"/>
    </chain>
    <chain id="NRD-AC-PR-ValidateNode-Output">
      <operation id="Context.FetchDocument"/>
      <operation id="RunOperation">
        <param name="id" type="string">NRD-AC-PR-UnlockDocument</param>
        <param name="isolate" type="boolean">false</param>
      </operation>
      <operation id="RunOperation">
        <param name="id" type="string">logInAudit</param>
        <param name="isolate" type="boolean">false</param>
      </operation>
    </chain>
    <chain id="NRD-AC-PR-force-validate">
      <operation id="Context.FetchDocument"/>
      <operation id="Auth.LoginAs">
        <param name="name" type="string">expr:Context["workflowInitiator"]</param>
      </operation>
      <operation id="Audit.LogEvent">
        <param name="event" type="string">Consultation time excedeed</param>
        <param name="category" type="string">Review workflow</param>
        <param name="comment" type="string">Some consultation tasks were aborted by the system as they received no feedback message.</param>
      </operation>
      <operation id="Workflow.ResumeNode"/>
    </chain>
    <chain id="NRD-AC-PR-storeTaskInfo">
      <operation id="Context.FetchDocument"/>
      <operation id="RunScript">
        <param name="script" type="string">This[0]</param>
      </operation>
      <operation id="Context.SetVar">
        <param name="name" type="string">tasksInfo</param>
        <param name="value" type="object">expr:NodeVariables["tasks"]</param>
      </operation>
      <operation id="Context.SetVar">
        <param name="name" type="string">numberNA</param>
        <param name="value" type="object">expr:NodeVariables["tasks"].getNumberEndedWithStatus("NA")</param>
      </operation>
      <operation id="Context.SetVar">
        <param name="name" type="string">numberRejected</param>
        <param name="value" type="object">expr:NodeVariables["tasks"].getNumberEndedWithStatus("reject")</param>
      </operation>
      <operation id="Context.SetVar">
        <param name="name" type="string">numberApproved</param>
        <param name="value" type="object">expr:NodeVariables["tasks"].getNumberEndedWithStatus("approve")</param>
      </operation>
      <operation id="Context.SetVar">
        <param name="name" type="string">numberOfTasks</param>
        <param name="value" type="object">expr:NodeVariables["numberOfTasks"]</param>
      </operation>
      <operation id="Render.Document">
        <param name="template" type="string">template:NRD-PR-TasksInfo</param>
        <param name="filename" type="string">output.ftl</param>
        <param name="mimetype" type="string">text/xml</param>
        <param name="type" type="string">ftl</param>
      </operation>
      <operation id="Context.SetWorkflowVar">
        <param name="name" type="string">review_result_file</param>
        <param name="value" type="object">expr:This.get(0)</param>
      </operation>
      <operation id="Context.SetWorkflowVar">
        <param name="name" type="string">review_result</param>
        <param name="value" type="object">expr:This.get(0).getString()</param>
      </operation>
    </chain>
    <chain id="cancelWorkflow">
      <operation id="Context.FetchDocument"/>
      <operation id="Context.SetVar">
        <param name="name" type="string">isParallelWF</param>
        <param name="value" type="object">expr:Event.context.getProperty("wfName").equals("wf.parallelDocumentReview.ParallelDocumentReview")?true:false</param>
      </operation>
      <operation id="RunOperation">
        <param name="id" type="string">expr:isParallelWF?"Document.Unlock":"voidChain"</param>
        <param name="isolate" type="boolean">false</param>
      </operation>
    </chain>
    <chain id="initInitiatorComment">
      <operation id="RunScript">
        <param name="script" type="string">if((NodeVariables["comment"] != "") AND (NodeVariables["comment"] != null)){
WorkflowVariables["initiatorComment"]= NodeVariables["comment"];}</param>
      </operation>
    </chain>
    <chain id="logInAudit">
      <operation id="Audit.LogEvent">
        <param name="event" type="string">expr:NodeVariables["button"] =="reject"?"chain.document.refused":"chain.document.validated"</param>
        <param name="category" type="string">Review workflow</param>
        <param name="comment" type="string">expr:@{nodeLastActor} @{NodeVariables["button"] =="reject"?"chain.document.refused":"chain.document.validated"} the document with the following comment: @{NodeVariables["comment"]}</param>
      </operation>
    </chain>
    <chain id="nextAssignee">
      <operation id="RunScript">
        <param name="script" type="string">if (NodeVariables["button"] == "validate") {
  WorkflowVariables["index"] = WorkflowVariables["index"] + 1;
}
else if (NodeVariables["button"] == "reject") {
  WorkflowVariables["index"] = WorkflowVariables["index"] - 1;
}
else if (NodeVariables["button"] == "submit") {
  WorkflowVariables["index"] = 0;
}</param>
      </operation>
    </chain>
    <chain id="notifyInitiatorEndOfWorkflow">
      <operation id="Context.FetchDocument"/>
      <operation id="Document.Mail">
        <param name="from" type="string">expr:Env["mail.from"]</param>
        <param name="message" type="string">The document was approved by every participant.</param>
        <param name="subject" type="string">expr:@{Env["nuxeo.notification.eMailSubjectPrefix"]} Document approved</param>
        <param name="to" type="stringlist">expr:Fn.getEmail(workflowInitiator)</param>
        <param name="HTML" type="boolean">false</param>
        <param name="rollbackOnError" type="boolean">true</param>
        <param name="viewId" type="string">view_documents</param>
      </operation>
    </chain>
    <chain id="reinitAssigneeComment">
      <operation id="RunScript">
        <param name="script" type="string">if((NodeVariables["comment"] != "") AND (NodeVariables["comment"] != null)){
NodeVariables["comment"]= null;}</param>
      </operation>
    </chain>
    <chain id="terminateWorkflow">
      <operation id="Context.FetchDocument"/>
      <operation id="RunOperation">
        <param name="id" type="string">logInAudit</param>
        <param name="isolate" type="boolean">false</param>
      </operation>
      <operation id="Context.RunDocumentOperationInNewTx">
        <param name="id" type="string">notifyInitiatorEndOfWorkflow</param>
        <param name="isolate" type="boolean">false</param>
        <param name="rollbackGlobalOnError" type="boolean">false</param>
      </operation>
      <operation id="RunOperation">
        <param name="id" type="string">expr:WorkflowVariables["validationOrReview"] == "validation"?"validateDocument":"voidChain"</param>
        <param name="isolate" type="boolean">false</param>
      </operation>
      <operation id="Audit.LogEvent">
        <param name="event" type="string">Review completed successfully</param>
        <param name="category" type="string">Review workflow</param>
        <param name="comment" type="string">All the participants of the review have approved the document.</param>
      </operation>
    </chain>
    <chain id="validateDocument">
      <operation id="Context.FetchDocument"/>
      <operation id="Document.FollowLifecycleTransition">
        <param name="value" type="string">approve</param>
      </operation>
      <operation id="Document.CheckIn">
        <param name="version" type="string">minor</param>
        <param name="comment" type="string">Automatic checkin after validation</param>
      </operation>
    </chain>
    <chain id="voidChain">
      <operation id="Context.FetchDocument"/>
    </chain>
  </extension>